package com.bcxj.apidriver.service;

import com.bcxj.apidriver.client.ServiceOrderClient;
import com.bcxj.apidriver.client.ServiceSsePushClient;
import com.bcxj.internalcommon.constant.IdentityConstant;
import com.bcxj.internalcommon.dto.OrderRequest;
import com.bcxj.internalcommon.dto.ResponseResult;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * ClassName: PayService
 * Package: com.bcxj.apidriver.service
 * Description:
 *
 * @Author BCXJ
 * @Create 2024/11/24 14:50
 * @Version 1.0
 * @Since 1.0
 */
@Service
public class PayService {

    @Autowired
    private ServiceSsePushClient serviceSsePushClient;
    @Autowired
    private ServiceOrderClient serviceOrderClient;
    /**
     * 司机推送支付消息给乘客
     * @param orderId
     * @param price
     * @param passengerId
     * @return
     */
    public ResponseResult pushPayinfo(String orderId, String price, String passengerId) {
        // 疯转消息
        OrderRequest orderRequest = new OrderRequest();
        orderRequest.setOrderId(Long.parseLong(orderId));
        serviceOrderClient.pushPayInfo(orderRequest);
        return ResponseResult.success();
    }
}
